<template>
  <div>
    <criteria-paged :model="model" v-ref:paged>
      <criteria partial='criteria'>
        <div partial>
        </div>
      </criteria>
      <data-grid :model="model" partial='list'>
        <template partial='head'>
          <tr>
            <th>用户名</th>
            <th>小区名称</th>
            <th>地址</th>
          </tr>
        </template>
        <template partial='body'>
          <td>{{row.f_user_name}}</td>
          <td>{{row.f_residential_area}}</td>
          <td>{{row.f_address}}</td>
        </template>
      <data-grid>
    </criteria-paged>
  </div>
</template>

<script>
import { PagedList } from 'vue-client'

export default {
  title: '安检计划项列表',
  data () {
    return {
      model: new PagedList('rs/sql/planItem', 20)
    }
  },
  props: [ 'check' ],
  watch: {
    'check' (val) {
      let condition = "f_checker='" + this.check.f_checker + "' and f_plan_year='" + this.check.f_plan_year + "'and f_plan_month='" + this.check.f_plan_month + "'"
      this.model.search(condition, {})
    }
  },
  ready () {
    if (this.check) {
      let condition = "f_checker='" + this.check.f_checker + "'and f_plan_year='" + this.check.f_plan_year + "'and f_plan_month='" + this.check.f_plan_month + "'"
      this.model.search(condition, {})
    }
  }
}
</script>
